package com.test.multithread.springBean.FactoryBeanTest;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

public class BeanFactoryPostProcessorApp implements BeanFactoryPostProcessor {
 
    private BeanFactoryPostProcessorApp(){
        System.out.println("BeanFactoryPostProcessorApp.BeanFactoryPostProcessorApp()");
    }
 
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("app");
        beanDefinition.setAttribute("says", "BeanFactoryPostProcessor");
        System.out.println("BeanFactoryPostProcessorApp.postProcessBeanFactory(): " + beanDefinition.getAttribute("says"));
    }
}